package chapter5;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description: 计算最大数出现的次数
 * Date:2021/4/4
 * ***************************************************************
 */
public class exc5_41 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter the numbers and 0-end: ");
		int maxTimes=1;
		int max=input.nextInt();
		int tmp=max;
		while(tmp!=0) {
			if(tmp>max){
				max=tmp;
				maxTimes=1;
			}else if(tmp==max){
				maxTimes++;
			}
			tmp=input.nextInt();
		}
		System.out.printf("Max occurs %d times.",maxTimes);
		
	}

}
